﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace idataplatform
{
    public partial class qhxtable : Form
    {
        public qhxtable()
        {
            InitializeComponent();
        }

        private void qhxtable_Load(object sender, EventArgs e)
        {
            conncls conns = new conncls();
            string qhxselSQL = "SELECT qtype,scqno,qname,qnos,qyxq,phoneno,hyno,fqyw,hxyw,hxddno,hxtime,hxdx,hxusers FROM qhxtab_ipark WHERE hxtime>='"+ DateTime.Now.Date.AddDays(-8).ToShortDateString() + "' and hxtime<='" + DateTime.Now.Date.AddDays(-1).ToShortDateString() + "'";
            
            dataGridView1.DataSource = conns.Dts(qhxselSQL);
            toolStripStatusLabel1.Text = dataGridView1.Rows.Count.ToString() + " 行";
        }

        private void 条件查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            qhxsel form2 = new qhxsel();
            form2.ShowDialog();
            if (form2.DialogResult == DialogResult.OK)
            {
                if (pubcls.qhxselSQL != "")
                {
                    conncls conns = new conncls();
                    dataGridView1.DataSource = conns.Dts(pubcls.qhxselSQL);
                    toolStripStatusLabel1.Text = dataGridView1.Rows.Count.ToString() + " 行";
                }
            }
        }
    }
}
